<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<jsp:directive.include file="seguranca/controleDeAcesso.jsp" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Lista de Livros Cadastrados </title>
</head>
<body>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>

<script>
$(document).ready(function() {
   $('table tbody tr:odd').attr('style','background-color:#f5f2f2;');
$('table tbody tr:even').attr('style','background-color:#d9d5d5;');});

</script>

<f:view>
<h:form>
			<nav id="menu">
			<ul>
				<li>
					<h:commandLink action="minhaBiblioteca.jsp">
						<h:outputText value="voltar a pagina inicial"></h:outputText>
					</h:commandLink>
				</li>
			    <li>
					<h:commandLink action="#{usuarioMB.logout}" >
						<h:outputText value="Efetuar logout"></h:outputText>
					</h:commandLink>
				</li>	
		
</ul>
</nav>
</h:form>
<h:form>
		<h:dataTable value="#{livromb.livroscadastrados}" var="Livro">
			<h:column>    				
		      <f:facet name="header"><h:outputText value="Titulo"></h:outputText></f:facet>    				
		      <h:outputText value="#{Livro.titulo}"></h:outputText>
		   </h:column>
		   <h:column>
		      <f:facet name="header"><h:outputText value="Autor"></h:outputText></f:facet>
		      <h:outputText value="#{Livro.autores}"></h:outputText>		  
		   </h:column>
		    <h:column>
		      <f:facet name="header"><h:outputText value="Emprestimo"></h:outputText></f:facet>
		     <h:form>
		     <h:commandButton action="#{cadastraemprmb.emprestar(Livro.id)}" value="Emprestar"></h:commandButton></h:form>		  
		   </h:column>
		 
		</h:dataTable>
		</h:form>
		
	</f:view>
</body>
</html>


</body>
</html>
